package com.ruoyi.huanghefd.controller;

import com.ruoyi.huanghefd.service.UserByRoleService;
import com.ruoyi.huanghefd.utils.PageBean;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @Author gnplum
 * @Date 2024/1/22 23:07
 * @PackageName:com.ruoyi.huanghefd.controller
 * @ClassName: UserByRoleController
 * @Description: TODO
 * @Version 1.0
 */
@RestController
@RequestMapping("/huanghefd")
public class UserByRoleController {
    private static final Logger log = LoggerFactory.getLogger(UserByRoleController.class);

    @Resource
    UserByRoleService userByRoleService;

    @PostMapping(value = "/queryUserByRole")
    public PageBean queryUserByRoleList(@RequestParam(required = false, value = "deptId") String deptId,
                                        @RequestParam(required = false, value = "userName") String userName,
                                        @RequestParam(required = false, value = "roleKey") String roleKey,
                                        @RequestParam(value = "pageNum") int pageNum,
                                        @RequestParam(value = "pageSize") int pageSize) {
        log.info(">> 查询工作票人员-入参==" + deptId + "," + userName + "," + roleKey);
        PageBean ajax = userByRoleService.queryUserByRoleByPage(deptId, userName, roleKey, pageNum, pageSize);//roleKey 标识哪类票哪类人
        log.info(">> 查询工作票人员-返回==" + ajax);
        return ajax;
    }
}
